package br.ufrj.dcc.dm.util;

import java.util.ArrayList;
import java.util.List;

import br.ufrj.dcc.dm.model.Entry;

public class AttributeFilter 
{

	public static List<Entry> retrieveFilteredEntries(List<Entry> originalEntries, int attributeIndex, String attributeValue)
	{
		List<Entry> entries = new ArrayList<Entry>();
		
		for(Entry originalEntry : originalEntries)
		{
			String value = originalEntry.get(attributeIndex).getValue();
			
			if(value.equals(attributeValue))
			{
				entries.add(originalEntry);
			}
		}
		
		return entries;
	}
}
